function common_share(options){
    var defaultFeatures={
        scrollbars:"no",
        status:"yes",   
        resizable:"no",
        titlebar:"no", 
        width:screen.availWidth-400,
        height:screen.availHeight-200,
        top:Math.ceil(100),
        left:Math.ceil(200)
    }
    this.options = $.extend({
        share_url:"www.aceona.com", 
        share_title:"红桃网", 
        share_pic:"",
        id:"",
        createPic:true,
        features:{
        },
        shareType:[{id:"tqq",
            url:"http://v.t.qq.com/share/share.php?title=?share_title&url=?share_url&site=www.aceona.com&pic=?share_pic&appkey="+encodeURI('7c3450bbecd247758089ee8df5cf546c'),
                    tip:"转播到腾讯微博",
                    styleClass:"em_a"
                   },
                   {id:"tsina",
                       url:"http://v.t.sina.com.cn/share/share.php?title=?share_title&url=?share_url&pic=?share_pic&appkey=" + 2937052444+ "&site=www.aceona.com&content=utf-8",
                       tip:"转播到新浪微博",
                       styleClass:"em_c"
                      },
                   {id:"qzone",
                       url:"http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url=?share_url&title=?share_title",
                       tip:"转播到QQ空间",
                       styleClass:"em_b"
                   },
                  {id:"bsh",
                      url:"http://bai.sohu.com/share/blank/add.do?link=?share_url&title=?share_title",
                      tip:"转播到白社会",
                      styleClass:"em_d"
                  },
                   {id:"douban",
                       url:"http://www.douban.com/recommend/?url=?share_url&title=?share_title",
                       tip:"转播到豆瓣网",
                       styleClass:"em_e"
                   }
                    ,
                    {id:"xiaonei",
                        url:"http://share.renren.com/share/buttonshare.do?link=?share_url&title=?share_title",
                        tip:"转播到人人网",
                        styleClass:"em_f"
                    }
        ]
  },options || {});
  this.options.features = $.extend(defaultFeatures,this.options.features);
  if(this.options.createPic)
  {
      this.createBar();
  }   
}
common_share.prototype={
        createBar:function(){
            var strStart='<div class="one_share c">';
            var strEnd='</div>';
            var shareTypes=this.options.shareType;
            for (var i = 0, len = shareTypes.length; i < len; i++) 
            {
                var _type = shareTypes[i];
                strStart+="<em class="+_type['styleClass']+" id="+_type.id+this.options.id+" title="+_type.tip+" onclick=\""+this.options.id+".snsShare('"+_type.id+this.options.id+"')\"></em>";
            }
            $("#"+this.options.id).html(strStart+strEnd);
    },
    snsShare:function(_id){
        var shareTypes=this.options.shareType;
        for (var i = 0, len = shareTypes.length; i < len; i++) 
        {
            var _type = shareTypes[i];
                    var id = _type.id+this.options.id;
                    if(_id==id)
                    {
                        var features = [];
                        for (var name in this.options.features) {
                            features.push(name + '=' + this.options.features[name]);
                        }
                        var url =_type.url.replace("?share_url",encodeURIComponent(this.options.share_url)).replace("?share_title",encodeURIComponent(this.options.share_title));
                        // 目前只有腾讯和新浪微博支持分享图片
                        if(_type.id == 'tqq' || _type.id == 'tsina')
                        {
                          url = url.replace("?share_pic",encodeURIComponent(this.options.share_pic));
                        }
                        window.open(url,_type.tip,features.join(','));
                        break;
                    }
                }
            }
}
